<template>
  <view class="content">
	  <uni-list :border="true" v-for="item in waitingList" v-if="waitingList && waitingList.length > 0">
		  <uni-list-chat link :title="item.processDefinitionName" avatar="https://web-assets.dcloud.net.cn/unidoc/zh/unicloudlogo.png" @click="toWaitingPage(item)" :note="'您有'+item.count+'条待办未处理'"  badge-positon="left" :badge-text="item.count"></uni-list-chat>
	  </uni-list>
  </view>
</template>

<script>
  import taskApi from "@/api/workflow/task.js";
  export default {
	data() {
		return {
			waitingList: []
		}
	},
    onLoad: function() {
		this.getTaskWaitCount()
    },
	methods: {
	  //获取当前登陆人待办数量
	  getTaskWaitCount(){
		 taskApi.getTaskWaitCount().then(res=>{
		 	this.waitingList = res.data
		 }) 
	  },
	  toWaitingPage(item) {
		this.$tab.navigateTo('/pages/workflow/waiting/waiting?processDefinitionKey='+item.processDefinitionKey)
	  }
	}
  }
</script>

<style>
  
</style>
